package com.example.demo.Repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.example.demo.Entity.Message;


/**
 * @version: V0.7
 * @author: 吴嘉鑫
 * @className: IMessageRepository
 * @packageName: com.example.demo.Repository
 * @description: 这是信息实体数据链接的接口
 * @data: 2021-07-20
 **/

public interface IMessageRepository extends JpaRepository<Message, Integer>{
	
	//@Query(value = "select b from message as b where b.userType=?1",nativeQuery = true)
	public List<Message> findByuserType(boolean userType);
	
	public Page<Message> findByUserType(boolean userType,Pageable pageable);
	
	public List<Message> findByUserName(String UserName);

	public Message findByMesID(Integer mesID);
}
